﻿using Informator.Presentation.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Informator.Presentation.Info_za_uplate
{

    public partial class pgInfo_za_uplate : Page
    {
        int i = 0;

        String[] smerovi = { "ELITE", "NET", "RT", "ASUV", "NRT", "MET", "AVT", "EPO" };
        string pozivNaBroj = "";
        string pozivIndex = "";
        string pozivBroj = "";
        string pozivGodina = "";

        DateTime dt = new DateTime();

        public pgInfo_za_uplate()
        {
            InitializeComponent();
            this.Loaded += (oo, ee) => { Animate.SlideUp(this); };

            cmbSmerovi.Items.Insert(0,"-- Изаберите смер --");
            cmbSmerovi.SelectedIndex = 0;

            cmbGodina.Items.Insert(0, "-- Изаберите годину уписа --");
            cmbGodina.SelectedIndex = 0;

            cmbBrIndex.Items.Insert(0, "-- Изаберите број индекса --");
            cmbBrIndex.SelectedIndex = 0;

            cmbSvrhaUplate.Items.Insert(0, "-- Сврха уплате --");
            cmbSvrhaUplate.SelectedIndex = 0;
           
            
            
            //dodavanje smerova
            for (int i = 0; i < smerovi.Length; i++)
                cmbSmerovi.Items.Add(smerovi[i].ToString());

            //dodavanje brojeva indexa
            for (int i = 1; i < 120; i++)
                cmbBrIndex.Items.Add(i);

            //dodavanje godina upisa
            for (int i = 1; i < 13; i++)
                cmbGodina.Items.Add(i);

            for (int i = 1; i < 15; i++)
                cmbSvrhaUplate.Items.Add("asdf: " + i);
          
        }

        public void ispitaj()
        {
            if (cmbGodina.SelectedIndex == 0 || cmbBrIndex.SelectedIndex == 0 || cmbSmerovi.SelectedIndex == 0)
            {
                MessageBox.Show("Morate izabrati sva polja");
            }
        }

        private void btnNazad_Click(object sender, RoutedEventArgs e)
        {
            Animate.SlideDownBack(this);
            Animate.ElementResponse(btnNazad);
            btnNazad.IsHitTestVisible = false;
        }

        private void btnGenerisi_Click(object sender, RoutedEventArgs e)
        {     
            if (cmbSmerovi.SelectedItem.ToString() == "ELITE")
                pozivIndex = "11";
            else if (cmbSmerovi.SelectedItem.ToString() == "NET")
                pozivIndex = "12";
            else if (cmbSmerovi.SelectedItem.ToString() == "RT")
                pozivIndex = "13";
            else if (cmbSmerovi.SelectedItem.ToString() == "ASUV")
                pozivIndex = "14";
            else if (cmbSmerovi.SelectedItem.ToString() == "NRT")
                pozivIndex = "15";
            else if (cmbSmerovi.SelectedItem.ToString() == "MET")
                pozivIndex = "16";
            else if (cmbSmerovi.SelectedItem.ToString() == "AVT")
                pozivIndex = "17";
            else if (cmbSmerovi.SelectedItem.ToString() == "EPO")
                pozivIndex = "18";

            pozivBroj = cmbBrIndex.SelectedItem.ToString();

            pozivGodina = cmbGodina.SelectedItem.ToString();

            txtPozivNaBroj.Text = pozivIndex + "-" + pozivBroj + "-" + pozivGodina;
        }

        private void cmbSmerovi_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Animate.SlideDownBack(this);
        }
    }
}
